/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.click.app.dao.hibernate;

import com.click.app.dao.PaymentsCutDao;
import com.click.app.model.Employee;
import com.click.app.model.PaymentsCut;
import java.util.Date;
import java.util.List;

/**
 *
 * @author ariel
 */
public class PaymentsCutDaoHibernate extends GenericDaoHibernate<PaymentsCut, Long> implements PaymentsCutDao{

    public PaymentsCutDaoHibernate() {
        super(PaymentsCut.class);
    }

    public List<PaymentsCut> findByDate(Date date) {
        return getHibernateTemplate().find("from PaymentsCut where datePay=?", date);
    }

    public List<PaymentsCut> findByEmployeePeriod(Employee employee, Date initDate, Date endDate) {
        Object[] objects = {employee, initDate, endDate};
        return getHibernateTemplate().find("from PaymentsCut where periodPaymentEmployee.employee=? and datePay Between ? And ? order by datePay", objects);
    }
}
